#pragma once

#include "DocumentManager.h"
#include "TermManager.h"
#include <fstream>

struct IndexData
{
	unsigned int documentIndex;
	unsigned int tf;
	float weight;
};

class SearchManager
{
public:
	SearchManager(std::string& filename, DocumentManager& dm, TermManager& tm);
	~SearchManager();
	IndexData* FindIndexData(std::string name);
	IndexData* FindIndexData(std::string name, TermData &td);
	IndexData* NextIndexData();
	DocumentManager* GetDocumentManager() { return &m_DocumentManager; };
private:
	IndexData* GetIndexData();

	std::ifstream m_File;
	DocumentManager& m_DocumentManager;
	TermManager& m_TermManager;
	TermData* m_pTermData;
	unsigned int m_TermCursor;
	IndexData m_TempIndexData;
};